package huashu.net.Investment.Report;

import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView;

import java.util.Map;

public class IReportView extends JasperReportsMultiFormatView {
    private JasperReport jasperReport;


    public IReportView() {

    }

    protected JasperPrint fillReport(Map<String ,Object> model ) throws Exception {
        if(model.containsKey("url")){
            setUrl(String.valueOf(model.get("url")));
            this.jasperReport= loadReport();
        }
        return super.fillReport(model);
    }

    protected JasperReport getReport()
    {
        return this.jasperReport;
    }


}
